<%--
 * list.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>

<display:table pagesize="5" class="displaytag" keepStatus="true"
	name="paintings" requestURI="${requestURI}" id="row">

	<security:authorize access="hasRole('CUSTOMER')">
		<display:column>
			<a href="painting/customer/edit.do?paintingId=${row.id}"><spring:message
					code="painting.edit" /></a>
		</display:column>
	</security:authorize>

	<spring:message code="painting.title" var="titleHeader" />
	<display:column property="title" title="${titleHeader}"
		sortable="false" />

	<spring:message code="painting.author" var="authorHeader" />
	<display:column property="author" title="${authorHeader}"
		sortable="false" />

	<spring:message code="painting.date" var="dateHeader" />
	<display:column property="date" title="${dateHeader}" sortable="false"
		format="{0,date,dd/MM/yyyy HH:mm}" />

	<spring:message code="painting.appraisal" var="appraisalHeader" />
	<display:column property="appraisal" title="${appraisalHeader}"
		sortable="false" />

	<spring:message code="painting.gallery" var="galleryHeader" />
	<display:column property="gallery.title" title="${galleryHeader}"
		sortable="false" />

	<security:authorize access="hasRole('ADMINISTRATOR')">
		<display:column>
			<a href="ownershipHistory/administrator/list.do?paintingId=${row.id}"><spring:message
					code="painting.history" /></a>
		</display:column>
	</security:authorize>

<%-- 	<security:authorize access="hasRole('CUSTOMER')"> --%>
<%-- 		<display:column> --%>
<%-- 		<jstl:if test="${paintingId!=row.id}"> --%>
		
		
<%-- 			<a href="auction/customer/create.do?paintingId=${row.id}"><spring:message --%>
<%-- 					code="painting.createAuction" /></a> --%>
<%-- 		</jstl:if> --%>
<%-- 		</display:column> --%>
		
	
<%-- 	</security:authorize> --%>
	
	<display:column>
		<a href="comment/list.do?paintingId=${row.id}"><spring:message
				code="painting.comments" /></a>
	</display:column>

</display:table>

<security:authorize access="hasRole('CUSTOMER')">

	<jstl:if test="${!notCreate }">
			<a href="painting/customer/create.do"><spring:message
			code="painting.createNew" /></a>
		</jstl:if>
	

</security:authorize>

<acme:cancel code="painting.goBack" url="${backURI}" />
